<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .hide {
            display: none;
        }
    </style>
</head>

<body>
    <div>hdcms.com</div>
    <div>houdunren.com</div>
    <script>
        // 点语法操作DOM节点元素
        let divs = document.querySelectorAll("div");

        console.log(divs instanceof NodeList);

        // Array.from(divs).map(function (item) {
        //     console.log(item);
        // });

        Array.prototype.map.call(divs, function (item) {
            console.log(item);
        });
        [...divs].map(function (item) {
            // console.log(item);
            item.addEventListener("click", function () {
                this.classList.toggle("hide");
            })
        });
    </script>
</body>

</html>